package view;

import java.awt.BorderLayout;
import java.awt.SystemColor;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ScrollPaneConstants;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;
import javax.swing.JTabbedPane;
import javax.swing.JButton;

public class PanelThongKeTest extends JPanel {
	private static final long serialVersionUID = -1011178966750323890L;
	private JTable table;
	private JTextField textField;
	private JTextField textField_1;
	private JComboBox<String> textField_2;
	private JTextField textField_3;
	private JTextField textField_4;

	/**
	 * Create the panel.
	 */
	public PanelThongKeTest() {
		setLayout(new BorderLayout(0, 0));
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		add(tabbedPane, BorderLayout.NORTH);
		
		JPanel panel_3 = new JPanel();
		tabbedPane.addTab("New tab", null, panel_3, null);
		
		JPanel panel_4 = new JPanel();
		tabbedPane.addTab("New tab", null, panel_4, null);
		
		JPanel panel_5 = new JPanel();
		tabbedPane.addTab("New tab", null, panel_5, null);
		
		JPanel panel_6 = new JPanel();
		tabbedPane.addTab("New tab", null, panel_6, null);
		
		JPanel panel_7 = new JPanel();
		tabbedPane.addTab("New tab", null, panel_7, null);
		
		JButton btnNewButton = new JButton("New button");
		panel_7.add(btnNewButton);

		JSplitPane splitPane = new JSplitPane();
		splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
		add(splitPane);

		JSplitPane splitPane_1 = new JSplitPane();
		splitPane.setLeftComponent(splitPane_1);

		JPanel panel = new JPanel();
		splitPane_1.setLeftComponent(panel);
		panel.setBorder(new TitledBorder(null,
				"Chi ti\u1EBFt th\u1ED1ng k\u00EA", TitledBorder.LEADING,
				TitledBorder.TOP, null, SystemColor.textHighlight));
		panel.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"), }, new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, }));

		JLabel lblNgyLp = new JLabel("Ngày lập");
		panel.add(lblNgyLp, "2, 2, left, default");

		textField = new JTextField();
		panel.add(textField, "4, 2, fill, default");
		textField.setColumns(10);

		JLabel lblNhnVinLp = new JLabel("Nhân viên lập");
		panel.add(lblNhnVinLp, "2, 4, left, default");

		textField_1 = new JTextField();
		panel.add(textField_1, "4, 4, fill, default");
		textField_1.setColumns(10);

		JPanel panel_1 = new JPanel();
		panel_1.setBorder(new TitledBorder(null,
				"Lo\u1EA1i th\u1ED1ng k\u00EA", TitledBorder.LEADING,
				TitledBorder.TOP, null, SystemColor.textHighlight));
		splitPane_1.setRightComponent(panel_1);
		panel_1.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"), }, new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, }));

		JRadioButton rdbtnNgy = new JRadioButton("Ngày");
		panel_1.add(rdbtnNgy, "2, 2");

		textField_4 = new JTextField();
		panel_1.add(textField_4, "4, 2, fill, default");
		textField_4.setColumns(10);

		JRadioButton rdbtnNm = new JRadioButton("Năm");
		panel_1.add(rdbtnNm, "6, 2");

		textField_3 = new JTextField();
		panel_1.add(textField_3, "8, 2, fill, default");
		textField_3.setColumns(10);

		JRadioButton rdbtnThng = new JRadioButton("Tháng");
		panel_1.add(rdbtnThng, "2, 4");

		JComboBox<String> comboBox = new JComboBox<String>();
		comboBox.setModel(new DefaultComboBoxModel<String>(new String[] { "1",
				"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }));
		panel_1.add(comboBox, "4, 4, fill, default");

		JRadioButton rdbtnQy = new JRadioButton("Qúy");
		panel_1.add(rdbtnQy, "6, 4");

		textField_2 = new JComboBox<String>();
		textField_2.setModel(new DefaultComboBoxModel<String>(new String[] {
				"1", "2", "3", "4" }));
		panel_1.add(textField_2, "8, 4, fill, default");

		JPanel panel_2 = new JPanel();
		panel_2.setBorder(new TitledBorder(null,
				"Danh s\u00E1ch th\u1ED1ng k\u00EA", TitledBorder.LEADING,
				TitledBorder.TOP, null, SystemColor.textHighlight));
		splitPane.setRightComponent(panel_2);
		panel_2.setLayout(new BorderLayout(0, 0));

		JScrollPane scrollPane = new JScrollPane();
		scrollPane
				.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
		scrollPane
				.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
		panel_2.add(scrollPane);

		table = new JTable();
		table.setModel(new DefaultTableModel(new Object[][] {}, new String[] {
				"STT", "M\u00E3 h\u00F3a \u0111\u01A1n", "Ng\u00E0y l\u1EADp",
				"Gi\u00E1 tr\u1ECB H\u0110" }));
		scrollPane.setViewportView(table);
	}

}
